format PE console
entry start
include 'C:\fasm\include\win32ax.inc'
section '.idata' import data readable
library kernel,'kernel32.dll', msvcrt,'msvcrt.dll', User32,'User32.dll'
import kernel, ExitProcess,'ExitProcess',Sleep,'Sleep'
import msvcrt, printf,'printf', getchar,'_fgetchar'
import User32, wsprintf,'wsprintfA'
section '.data' data readable writeable
	divisionZero db 'Division by zero error!', 13, 10 , 0
	strInteger db '%d', 13, 10 , 0
	strBuffer rb 64
	c_msg db 'c: ', 0
	b_msg db 'b: ', 0
	a_msg db 'a: ', 0
section '.code' code readable executable
start:
	push ebp
	mov ebp, esp
	sub esp, 1
	mov eax, 0
	mov ecx, ebp
	sub ecx, 1
	mov [ecx], eax
	sub esp, 4
	mov eax, 3
	mov ecx, ebp
	sub ecx, 5
	mov [ecx], eax
	sub esp, 4
	mov eax, 2
	mov ecx, ebp
	sub ecx, 1
	mov [ecx], eax
	mov ecx, ebp
	sub ecx, 1
	mov eax, [ecx]
	push eax
	mov eax, 2
	pop edx
	cmp eax, edx
	jne L1
L0:	sub esp, 1
	mov eax, 4
	mov ecx, ebp
	sub ecx, 10
	mov [ecx], eax
	sub esp, 4
	mov ecx, ebp
	sub ecx, 10
	mov esi, [ecx]
	ccall [wsprintf], strBuffer, strInteger, esi
	ccall [printf], c_msg
	ccall [printf], strBuffer
	add esp, 5 ;Note Here!
L1:	mov ecx, ebp
	sub ecx, 5
	mov esi, [ecx]
	ccall [wsprintf], strBuffer, strInteger, esi
	ccall [printf], b_msg
	ccall [printf], strBuffer
	mov ecx, ebp
	sub ecx, 1
	mov esi, [ecx]
	ccall [wsprintf], strBuffer, strInteger, esi
	ccall [printf], a_msg
	ccall [printf], strBuffer
	add esp, 9 ;Note Here!
	stdcall [ExitProcess],0